<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
	<title>余额记录</title>
	<link rel="stylesheet" type="text/css" href="../../css/aui.css" />
	<link rel="stylesheet" type="text/css" href="./css/my.css" />
</head>

<body>
	<div class="income_bg" style="padding-top: 0px;">
		<div class="order_box" style="margin-top: 0px">
			<div class="container">
				<div class="contentlist">


				</div>
			</div>
		</div>
	</div>
	<!--加载loading-->
	<div class="index_loading">
		<img src="./image/index_loading.gif" />
		<span>加载中,请稍后...</span>
	</div>
	<!--暂无数据-->
	<div class="temporarily_data" style="display:none;">
		<img src="./image/no_date.png" />
		<span>暂无数据</span>
	</div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/config.js"></script>
<script type="text/javascript" src="../../script/zepto.min.js"></script>
<script type="text/javascript" src="../../script/doT.min.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script id="mybalancelog-tmpl" type="text/x-dot-template">
	{{ for(var i=0, catlen=it.length; i
	<catlen; i++) {}} <div class="contentinfo aui-border-b">
		<div class="contentleft">
			{{? it[i].type==2}}
			<img src="../../image/icon_{{=it[i].source_type}}.png" onerror="this.src='../../image/icon_money.png'" /> {{??}}
			<img src="../../image/icon_money.png" /> {{?}}
			<div class="sign">
				{{?it[i].type==1}}提现{{??}}收入{{?}}金额：{{=it[i].money}}元
			</div>
			<div class="color-gray m-top">
				{{=it[i].desc}}
			</div>
		</div>
		<div class="state">
			{{? it[i].type==1}} {{? it[i].status==1}} 待支付 {{?}} {{? it[i].status==2}} 已支付 {{?}} {{?? it[i].type==2}} 已结算 {{?}}
		</div>
		<div class="color-gray commission-time" style="margin-left:48px;">
			{{=it[i].addtime}}
		</div>
		</div>
		{{ }}}
</script>
<script type="text/javascript">
	var pageParam = {
		pageindex: 1,
		isloaded: true
	};
	apiready = function() {
		doGetMybalanceLog();
		pullDown(function(){
			$(".contentlist").empty();
			pageParam.pageindex=1;
			pageParam.isloaded=true;
			doGetMybalanceLog();
		},true)
		doScroll();
	};

	function doGetMybalanceLog() {
		if (!pageParam.isloaded) {
			return;
		}
		$('.temporarily_data').hide();
		$(".index_loading").show();
		postDataLogin('getMyMoneyLog', {
			pageindex: pageParam.pageindex
		}, function(res) {
			$(".index_loading").hide();
			if (res.code == 1) {
				var list = doT.template(($('#mybalancelog-tmpl')).text());
				$(".contentlist").append(list(res.data));
				pageParam.isloaded = true;
			} else {
				pageParam.isloaded = false;
				if (pageParam.pageindex == 1) {
					$('.temporarily_data').show();
				} else {
					$(".index_loading img").hide();
					$(".index_loading span").html("<div style='color:#dddddd'>—这是我的底线—</div>");
					$(".index_loading").show();
				}
			}
		})
	}

	function doScroll() {
		getMoreGoods(function() {
			if (pageParam.isloaded) { //没数据就不加载了
				pageParam.pageindex++;
				doGetMybalanceLog();
			}
		});
	}
</script>

</html>
